package com.app.outdoor.InvoikeServices;

import java.util.ArrayList;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import android.util.Log;

import com.app.Network.Protocol;

public class CommonInvoike extends BaseInvoike {
	final static private String url=Protocol.SERVER_URL+"/CommonServlet";
	final static String TAG=Protocol.TAG;
	public static void vaoNhomThaoLuan(int idNguoiGui, int idNguoiNhan) throws Exception{
		ArrayList<NameValuePair> params=new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair(Protocol.CMD, Protocol.GUI_TIN_NHAN));
		params.add(new BasicNameValuePair(Protocol.MSG_TYPE, Protocol.JOIN_GROUP));
		params.add(new BasicNameValuePair(Protocol.NGUOI_GUI, idNguoiGui+""));
		params.add(new BasicNameValuePair(Protocol.NOI_DUNG, "ko"));
		params.add(new BasicNameValuePair(Protocol.NGUOI_NHAN, idNguoiNhan+""));
		post(url, params);
		Log.d(TAG,"CommonInvoike.vaoNhomThaoLuan");
	}
	public static void guiTinNhan(String idNguoiGui,String idNguoiNhan,String noiDung,String msgType) throws Exception{
		ArrayList<NameValuePair> params=new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair(Protocol.CMD, Protocol.GUI_TIN_NHAN));
		params.add(new BasicNameValuePair(Protocol.MSG_TYPE, msgType));
		params.add(new BasicNameValuePair(Protocol.NGUOI_GUI, idNguoiGui));
		params.add(new BasicNameValuePair(Protocol.NOI_DUNG, noiDung));
		params.add(new BasicNameValuePair(Protocol.NGUOI_NHAN, idNguoiNhan+""));
		post(url, params);
	}
}
